package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	comm "gitee.com/cloudapex/protos/comm/pb"
	gpb "gitee.com/cloudapex/protos/crm_base/pb"
	"google.golang.org/grpc"
)

/**
 * 出格登记
 */
var PoolOutNode outnode

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_CRM_BASE, func(c *grpc.ClientConn) {
		PoolOutNode.cli = gpb.NewPoolOutNodeSerClient(c)
	})
}

type outnode struct {
	cli gpb.PoolOutNodeSerClient
}

/**
 *说明：添加记录
 */

func (this *outnode) PoolOutNodeAdd(ctx context.Context, in *gpb.PoolOutNode) (*comm.BaseRes, error) {
	return this.cli.PoolOutNodeAdd(ctx, in)
}

/**
 *说明：查询单条记录
 */
func (this *outnode) SelectPoolOutNode(ctx context.Context, in *gpb.PoolOutNode) (*gpb.BaseOutRes, error) {
	return this.cli.SelectPoolOutNode(ctx, in)
}

/**
 *说明：更改单条记录 审核过之后需要修改oper_id
 */
func (this *outnode) EditPoolOutNode(ctx context.Context, in *gpb.PoolOutNode) (*comm.BaseRes, error) {
	return this.cli.EditPoolOutNode(ctx, in)
}

/**
 *说明：获取出格记录列表
 */
func (this *outnode) GetPoolOutNodeList(ctx context.Context, in *gpb.PoolOutNodeReq) (*gpb.PoolOutNodeRes, error) {
	return this.cli.GetPoolOutNodeList(ctx, in)
}

/**
 *说明：移除单条记录（一般用不到）
 */
func (this *outnode) DelPoolOutNode(ctx context.Context, in *comm.BaseReq) (*comm.BaseRes, error) {
	return this.cli.DelPoolOutNode(ctx, in)
}
